home *** CD-ROM | disk | FTP | other *** search
/ 220 Jogos / 220 jogos.iso / classicos / resta11 / STree.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-12-24  |  1.4 KB  |  63 lines

  1. // STree.h: Schnittstelle fⁿr die Klasse STree.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_STREE_H__B9D42B39_6A5B_4A7C_8E7C_289DFD0AAF9E__INCLUDED_)
  6. #define AFX_STREE_H__B9D42B39_6A5B_4A7C_8E7C_289DFD0AAF9E__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. #include <GL\glu.h>
  13. #include "STexture.h"
  14.  
  15.  
  16. #define BAUM_HOEHE 0.5f
  17. #define BAUM_BREITE 0.35f
  18. #define STAMM_HOEHE 1.5f
  19. #define STAMM_BREITE 0.15f
  20. #define SPACE 1.0f
  21. #define MATRIX_SIZE 7
  22.  
  23. enum STreeState
  24. {    
  25.     STATE_SHOWN,
  26.     STATE_DRAGGING,
  27.     STATE_HIDDEN,
  28.     STATE_DESTROYING
  29. };
  30.  
  31. class STree  
  32. {
  33. public:
  34.     STreeState getState();
  35.     void setFinalPos(int xTest,int yTest);
  36.     int* resolveFinalPos(float xTest, float yTest);
  37.     int getYMatrixPos();
  38.     int getXMatrixPos();
  39.     void setState(STreeState state);
  40.     bool click(float x, float y);
  41.     void draw();
  42.     void update(float frametime);
  43.     void setPosition(float x, float y, float z);
  44.     bool create(STexture* texBaum,STexture* texStamm);
  45.     STree();
  46.     virtual ~STree();
  47. protected:
  48.     STexture* baum;
  49.     STexture* stamm;
  50.  
  51.     float position[3];
  52.     GLUquadricObj* quadric;
  53.     STreeState treeState;
  54.     int matrixPos[2];
  55.     float rotation[2];
  56.     float rotSpeed[2];
  57.     float lastRealPos[2];
  58.     float size;
  59.     int destructionMethod;
  60. };
  61.  
  62. #endif // !defined(AFX_STREE_H__B9D42B39_6A5B_4A7C_8E7C_289DFD0AAF9E__INCLUDED_)
  63.